
    /**  
    * @Title: LockerFactory.java
    * @Package com.efast.cafe.framework.redis.locker
    * @Description: TODO(用一句话描述该文件做什么)
    * @author Administrator
    * @date 2019年1月17日
    * @version V1.0  
    */
    
package com.efast.cafe.framework.redis.locker;


import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.efast.cafe.framework.spring.SpringContextUtils;

/**
    * @ClassName: LockerFactory
    * @Description: TODO(这里用一句话描述这个类的作用)
    * @author Administrator
    * @date 2019年1月17日
    *
    */

public class LockerFactory {

	public static String LOCKER_BEAN_PRE="locker_";
	
	static Logger logger = LoggerFactory.getLogger(LockerFactory.class);
	
	public static RedissonDistributedLocker getLocker(String group){
		try{
			return SpringContextUtils.getBean(LOCKER_BEAN_PRE+group, RedissonDistributedLocker.class);
		}catch(Exception e){
			logger.error("get locker by "+group+" error.",e);
		}
		return null;
	}
	
}
